<?php

/*插件的设置页面新增导出excel按钮
代码看不懂欢迎
RMB:50 Yuan
联系QQ:2562122893

*/
<?php
namespace app\plugins\tuijianren_plg\admin;

use think\Controller;
use app\index\model\Auction as AuctionModel;
use think\Log;


class Admin extends Controller
{
    public function ExcelExport()
	{

        $data = AuctionModel::all();
        // Excel驱动导出数据

        
        //对象转换为数组

        $data_arr = $data->toarray();
        
        //lang 语言文件里面新增excel_auction_title_list
		$excel = new \base\Excel(array('filename'=>'auction', 'title'=>lang('excel_auction_title_list'), 'data'=>$data_arr, 'msg'=>'没有相关数据'));
        
        //
		//file_put_contents("c:\paimai.log",'tuijianren_plg 导出Excel');

        $excel->Export();
	}
}
?>


